Skip to content

Instantly share code, notes, and snippets.

@klezVirus
klezVirus / EtwStartWebClient.cs
Last active May 21, 2024 20:52
A PoC in C# to enable WebClient Programmatically
using System.Runtime.InteropServices;
using System;
/*
* Simple C# PoC to enable WebClient Service Programmatically
* Based on the C++ version from @tirannido (James Forshaw)
* Twitter: https://twitter.com/tiraniddo
* URL: https://www.tiraniddo.dev/2015/03/starting-webclient-service.html
*
* Compile with:
@ghinda
ghinda / object-to-form-data.js
Last active May 21, 2024 20:48
JavaScript Object to FormData, with support for nested objects, arrays and File objects. Includes Angular.js usage.
// takes a {} object and returns a FormData object
var objectToFormData = function(obj, form, namespace) {
var fd = form || new FormData();
var formKey;
for(var property in obj) {
if(obj.hasOwnProperty(property)) {
if(namespace) {
@Tamal
Tamal / set-chroot.sh
Last active May 21, 2024 20:43
Setting up chroot from a live image in Fedora. Regenerate grub2 for Fedora.
$ # Use Live CD to boot
$ sudo su # Switch to root
$ fdisk -l # Get names of root, boot & EFI partition names. you can also use blkid
$ mount /dev/mapper/fedora_localhost--live-root /mnt # mount root partition
$ cat /mnt/etc/fedora-release
Fedora release 31 (Thirty One)
$ mount /dev/nvme0n1p2 /mnt/boot # mount boot partition
$ mount /dev/nvme0n1p1 /mnt/boot/efi # mount EFI partition
# Note: If you are not able to mount EFI partition ('Input/Output error'),
# You may have to repair ESP file system or format ESP.
@denji
denji / copy-db.sh
Last active May 21, 2024 20:43 — forked from rcmachado/copy-db.sh
Script to copy all tables from one database to another.
#!/bin/bash
#
# Script to copy all tables from one database to another.
#
# Requires:
# * MySQL 5.6
# * Percona xtrabackup tools (http://www.percona.com/software/percona-xtrabackup)
#
# Known caveats:
# * Will copy structure of all tables from one database to another, but only InnoDB
@powerman
powerman / AsciidocCheatsheet.adoc
Last active May 21, 2024 20:42
Asciidoc cheatsheet for GitHub

Asciidoc cheatsheet for GitHub

@realvjy
realvjy / ChoasLinesShader.metal
Last active May 21, 2024 20:39
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@vasanthk
vasanthk / System Design.md
Last active May 21, 2024 20:38
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@mattn
mattn / dump.vim
Created December 6, 2011 13:18 — forked from ynkdir/dump.vim
google-calendar-holiday
scriptencoding utf-8
let s:calendar_list = [
\ ['Australian Holidays', 'en.australian#holiday@group.v.calendar.google.com'],
\ ['Austrian Holidays', 'en.austrian#holiday@group.v.calendar.google.com'],
\ ['Brazilian Holidays', 'en.brazilian#holiday@group.v.calendar.google.com'],
\ ['Canadian Holidays', 'en.canadian#holiday@group.v.calendar.google.com'],
\ ['China Holidays', 'en.china#holiday@group.v.calendar.google.com'],
\ ['Christian Holidays', 'en.christian#holiday@group.v.calendar.google.com'],
\ ['Danish Holidays', 'en.danish#holiday@group.v.calendar.google.com'],